package com.csx.micrometer.demo.consumer.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author cuisongxu
 * @date 2022/12/4 15:59
 */
@FeignClient(value = "demo-micrometer-provider")
public interface DemoProviderClient {

    @GetMapping("/provider/getUsername")
    String getUserName(@RequestParam("code") Integer code);

    /**
     * 测试随机性运行时异常
     * @return
     */
    @GetMapping("/provider/testRandomError")
    String testRandomError();

    /**
     * 测试超时异常
     * @return
     */
    @GetMapping("/provider/testTimeout")
    String testTimeout();

    /**
     * 测试不存在的接口异常
     * @return
     */
    @GetMapping("/provider/testNotExistEndpoint")
    String testNotExistEndpoint();

}
